﻿using System;
using System.Text;

namespace Game
{
    class Hunter : Player
    {
        public Hunter(int x, int y)
        {
            if (x >= 30)
            {
                this.x = this.x;
                this.lives = 3;
            }
            else
                this.x = 405;
            if (y >= 30)
            {
                this.y = this.y;
            }
            else
                this.y = 405;
        }
        public int PropLastStep
        {
            get { return this.last_step; }
            set { this.last_step = value; }
        }
        public void KillPlayer(ref Player player)
        {
            int pl_lives = player.PropLives;
            pl_lives = pl_lives - this.atac;
            player.setLives(pl_lives);
            Random r = new Random();
            int step = r.Next(1, 5);
            int step2 = r.Next(1, 10);
            int plus = r.Next(0, 1);
            if (plus == 1)
            {
                player.PropX = player.PropX + step2 * 25; player.PropY = player.PropY + step * 25;
            }
            else
            {
                player.PropX = player.PropX - step2 * 25; player.PropY = player.PropY - step * 25;
            }

            if (player.PropX > 405 || player.PropX < 30)
            {
                player.PropX = 405 - step2 * 25;
            }
            if (player.PropY > 405 || player.PropY < 30)
            {
                player.PropY = 405 - step * 25;
            }
        }
        private int atac = 1; // кол-во жизней которое отнимается
        private int last_step = 0; // предыдущий шаг охонтика (чтобы он не ходил дважды одинаково, по умолчанию 0)
    }
}
